package com.planesnet.activity6;

import com.planesnet.activity6.R;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
/**
 * Comparte un dato binario con otra aplicación.
 * @author "Luis Planes"
 *
 */
public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	public void onClickSend(View v) {
		
		Uri uri = Uri.parse("android.resource://com.planesnet.activity6/drawable/ic_launcher");
		
		Intent shareIntent = new Intent();
		shareIntent.setAction(Intent.ACTION_SEND);
		shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
		shareIntent.setType("image/png");
		startActivity(Intent.createChooser(shareIntent,
				getResources().getText(R.string.send_to)));
	}

}
